package com.springboot.cloud.dao;

import java.util.List;

import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Update;

import com.springboot.cloud.entities.Comment;

@Mapper
public interface CommentMapper {

	public List<Comment> getall(@Param("0")int article);

	public List<Comment> getmycomments(@Param("0")int id);

	public boolean addcomment(Comment c);

	@Update("update comments set comments.like = comments.like+1 where id=#{0}")
	public boolean caddlike(@Param("0")int id);
	
	@Update("update comments set comments.nolike = comments.nolike+1 where id=#{0}")
	public boolean caddnolike(@Param("0")int id);

}
